<template>

    <EleTableComp :config="config"></EleTableComp>

</template>
  <script>
import EleTableComp from "@/components/EleTableComp";
import { typeJson } from "@/components/EleTableComp/config.js";
export default {
  data() {
    return {
      config: {
        header: {
          breadcrumb: `日常检查记录`,
          addButton: false,
          search: [
            {
              type: "datePicker",
              value: "",
              prop: "startDate",
              label: "开始日期",
            },
            {
              type: "datePicker",
              value: "",
              prop: "endDate",
              label: "至",
            },
            {
              type: "input",
              prop: "planName",
              placeholder: "",
              value: "",
              label: "计划名称",
            },
            // {
            //   type: "netDropDown",
            //   prop: "deptId",
            //   value: "",
            //   label: "部门",
            //   list: {
            //     url: "/organization/getList?",
            //     label: "orgName",
            //     value: "id",
            //     mineId: false,
            //     data: {},
            //   },
            // },
          ],
        },
        footer: {
          pagination: true,
        },
        table: [
          {
            type: "index",
            addEditHidden: true,
          },
          {
            label: "计划名称",
            prop: "planId",
            value: "",
            addEditType: "netDropDown",
            hidden: true,
            list: {
              url: "/app/checkPlan/getList?",
              label: "planName",
              value: "id",
              // mineId: true,
              data: {},
            },
            required: true,
          },
          {
            label: "计划名称",
            prop: "planName",
            addEditHidden: true,
            value: "",
          },

          {
            label: "检查人",
            prop: "checkMan",
            value: "",
            required: true,
            hidden: true,
          },
          {
            label: "检查部位",
            prop: "checkPart",
            value: "",
            addEditHidden: true,
          },
          {
            label: "记录日期",
            prop: "checkDate",
            value: "",
            addEditType: "timePicker",
            required: true,
          },
          {
            label: "检查情况",
            prop: "situation",
            value: "",
            required: true,
          },
          {
            label: "隐患数量",
            prop: "riskQty",
            value: "",
            dataType: "int",
            hidden: true,
          },
          {
            label: "是否有隐患",
            prop: "isRisk",
            value: "",
            type: "dropDown",
            addEditType: "dropDown",
            list: typeJson.bool,
            required: true,
          },

          {
            prop: "photo",
            label: "照片",
            type: "download",
            addEditType: "upload",
            value: "",
            limit: 1,
            mediaOnly: true,
          },
          {
            label: "操作",
            prop: "", // 传数据的时候 忽略
            type: "operation",
            isParam: false,
            addEditHidden: true,
            look: true,
            edit: false,
            delete: true,
            mineType: this.$store.state.mineType,
          },
        ],
        update: {
          url: "/app/checkRec/update",
          method: "POST",
          data: this.form,
        },
        delete: {
          url: "/app/checkRec/delete",
          method: "GET",
          id: -1,
        },
        insert: {
          url: "/app/checkRec/insert",
          method: "POST",
          data: this.form,
          // mineId: true,
        },
        select: {
          url: "/app/checkRec/getList",
          method: "POST",
          // mineId: true,
          params: {
            planType: 1,
          },
          currentPage: 1,
          pageSize: 100,
        },
      },
    };
  },
  components: {
    EleTableComp,
  },
};
</script>
  